<!DOCTYPE html>
<html>
  <head>
    <script src="../../dist/jspsych.js"></script>
    <script src="../../dist/plugin-image-keyboard-response.js"></script>
    <script src="../../dist/plugin-preload.js"></script>
    <link rel="stylesheet" href="../../dist/jspsych.css">
  </head>
  <body></body>
  <script>

    var jsPsych = initJsPsych({
      default_iti: 250,
      on_finish: function() {
        jsPsych.data.displayData();
      }
    });

    var preload = {
      type: jsPsychPreload,
      auto_preload: true
    };

    var trial_1 = {
      type: jsPsychImageKeyboardResponse,
      stimulus: '../img/happy_face_1.jpg',
      choices: ['y','n'],
      render_on_canvas: false,
      stimulus_width: 300,
      prompt: '<p>Is this face happy? Press "y" or "n".</p>'
    };

    var trial_2 = {
      type: jsPsychImageKeyboardResponse,
      stimulus: '../img/sad_face_2.jpg',
      choices: ['y','n'], 
      render_on_canvas: false,
      stimulus_width: 300,
      prompt: '<p>Is this face happy? Press "y" or "n".</p>'
    };

    var trial_3 = {
      type: jsPsychImageKeyboardResponse,
      stimulus: '../img/happy_face_2.jpg',
      choices: ['y','n'], 
      render_on_canvas: false,
      stimulus_width: 300,
      prompt: '<p>Is this face happy? Press "y" or "n".</p>',
    };

    jsPsych.run([preload, trial_1, trial_2, trial_3]);

  </script>
</html>
